//
//  RxExampleViewController.swift
//  Example
//
//  Created by T AO on 2022/2/14.
//

import UIKit
import RxSwift

class RxExampleViewController: BaseViewController {
    
    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
        
        self.rx.isVisible
            .subscribe(onNext: { print("当前页面显示状态：\($0)") })
            .disposed(by: disposeBag)
        
        self.rx.viewDidLoad
            .subscribe(onNext: { print("viewDidLoad") })
            .disposed(by: disposeBag)
        
        self.rx.viewWillAppear
            .subscribe(onNext: { _ in print("viewWillAppear") })
            .disposed(by: disposeBag)
        
        self.rx.viewDidAppear
            .subscribe(onNext: { _ in print("viewDidAppear") })
            .disposed(by: disposeBag)
        
        self.rx.viewWillDisappear
            .subscribe(onNext: { _ in print("viewWillDisappear") })
            .disposed(by: disposeBag)
        
        self.rx.viewDidDisappear
            .subscribe(onNext: { _ in print("viewDidDisappear") })
            .disposed(by: disposeBag)
        
        self.rx.viewWillLayoutSubviews
            .subscribe(onNext: { print("viewWillLayoutSubviews") })
            .disposed(by: disposeBag)
        
        self.rx.viewDidLayoutSubviews
            .subscribe(onNext: { print("viewDidLayoutSubviews") })
            .disposed(by: disposeBag)
        
        self.rx.willMoveToParentViewController
            .subscribe(onNext: { _ in print("willMoveToParentViewController") })
            .disposed(by: disposeBag)
        
        self.rx.didMoveToParentViewController
            .subscribe(onNext: { _ in print("didMoveToParentViewController") })
            .disposed(by: disposeBag)
        
        self.rx.didReceiveMemoryWarning
            .subscribe(onNext: { print("didReceiveMemoryWarning") })
            .disposed(by: disposeBag)
        
        self.rx.isDismissing
            .subscribe(onNext: { print("当前页面状态：\($0)") })
            .disposed(by: disposeBag)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

    }

}
